{include file='public/meta'}
<title>服务列表</title>
</head>
<body>
{include file='public/header'}
{include file='public/menu'}

<section class="Hui-article-box">
	<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
		<span class="c-gray en">&gt;</span>
		{$controller}
		<span class="c-gray en">&gt;</span>
		{$action}
		<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
	</nav>
	<div class="Hui-article">
		<article class="cl pd-20">			
			<div class="cl pd-5 bg-1 bk-gray mt-20">
				<span class="l">
					<a id="lunbo_add" class="btn btn-primary radius" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加轮播</a>
				</span>
				<span class="r">共有数据：<strong>{$data|count}</strong> 条</span>
			</div>
			<div class="mt-20">
				<table class="table table-border table-bordered table-bg table-hover table-sort">
					<thead>
						<tr class="text-c">
							<th>ID</th>
							<th>轮播标题</th>
							<th>轮播图片</th>
							<th>轮播链接</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						{volist name="data" id="vo"}
						<tr class="text-c va-m">
							<td>{$vo.id}</td>
							<td>{$vo.title}</td>
							<td><img width="60" class="product-thumb" src="/static/upload/system/{$vo.thumb}"></td>
							<td>{$vo.link}</td>
							<td class="td-manage">
								<a style="text-decoration:none" class="ml-5" onClick="lunbo_del(this,{$vo.id})" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a>
							</td>	
						</tr>
						{/volist}
					</tbody>
				</table>
			</div>
		</article>
	</div>
</section>

{include file='public/footer'}
<!--请在下方写此页面业务相关的脚本-->
{load href='/static/lib/My97DatePicker/4.8/WdatePicker.js'}
{load href='/static/lib/datatables/1.10.0/jquery.dataTables.min.js'}
{load href='/static/lib/laypage/1.2/laypage.js'}
{js href="_js_/layer/layer.js"}

<script type="text/javascript">
	$('#lunbo_add').click(function(){
		// layer_show('添加轮播','{:url('admin/system/lunbo_add')}','370','300');
		layer.open({
			type: 2,
			area: ['550px', '500px'],
			fix: false, //不固定
			maxmin: true,
			shade:0.4,
			title: '添加轮播',
			content: '{:url('admin/system/lunbo_add')}',
			end:function(){
				location.href = '{:url('admin/system/lunbo_list')}';
			}
		});
	})

	//单个删除
	function lunbo_del(obj,id){
		layer.confirm('确认要删除吗？',{icon:3,title:'提示'},function(index){
			var data = 'id='+id;
			$.post('{:url('admin/system/do_del')}',data,function(res){
				if(res.msg == '删除成功'){
					$(obj).parents("tr").remove();
				}
				layer.msg(res.msg,{icon:1,time:1000});
			})

		});
	}


</script>
</body>
</html>	